package com.demo.core.model;

import com.demo.core.model.support.SimpleBaseModel;

/**
 * 文件模型
 * 所有文件都将保存在模型中
 * <p>将模型中的type字段代表对象的在应用层面的类型
 * 		即系统内置文件、用户上传文件等。  </p>
 * <p>contentType字段代表对象自身的类型
 * 		即xls、jpeg、docx等。下载时浏览器将获取该类型
 * </p>
 *
 */
public class File extends SimpleBaseModel implements java.io.Serializable {
	
	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = -3006858386882455446L;

	/**
     * 状态，文件记录被隐藏，逻辑删除
     */
    public static final String STATUS_HIDE = "hide";
    
    /**
     * 状态，文件表正常状态
     */
    public static final String STATUS_NORMAL = "normal";
    
    /**
     * 系统内置(由启动加载,不可删除)
     */
    public static final String TYPE_INNER = "inner";
    
    /**
     * 用户自定义(可删除的)
     */
    public static final String TYPE_CUSTOM = "custom";
    
	/**
	 * 所属目录id
	 */
	private Long folderId;
	
	/**
	 * 站点外键ID
	 */
	private Long siteId;
	
	/**
	 * 唯一标示
	 */
	private String uuid;
	
	/**
	 * 名称
	 */
	private String name;
	
	/**
	 * 文件路径
	 */
	private String path;
	
	/**
	 * 文件展示名
	 */
	private String title;
	
	/**
	 * 文件内容
	 */
	private byte[] content;
	
	/**
	 * 内容类型，用于下载时设置正确的类型
	 */
	private String contentType;
	
	/**
	 * 文件大小
	 */
	private Long size;
	
	/**
	 * 如果是图片文件：文件宽度
	 */
	private Integer width;
	
	/**
	 * 如果是图片文件：文件高度
	 */
	private Integer height;
	
	/**
	 * 文件类型：站点内置，用户内置等
	 */
	private String type;
	
	/**
	 * 是否可用标志
	 */
	private boolean enabled;
	
	/**
	 * 状态，隐藏，显示等
	 */
	private String status;
	
	/**
	 * 优先级
	 */
	private int priority;
	
	public Long getFolderId() {
		return folderId;
	}
	public void setFolderId(Long folderId) {
		this.folderId = folderId;
	}
	public Long getSiteId() {
		return siteId;
	}
	public void setSiteId(Long siteId) {
		this.siteId = siteId;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPath() {
		return path;
	}
	public void setPath(String path) {
		this.path = path;
	}
	public byte[] getContent() {
		return content;
	}
	public void setContent(byte[] content) {
		this.content = content;
	}
	public String getContentType() {
		return contentType;
	}
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	public Integer getWidth() {
		return width;
	}
	public void setWidth(Integer width) {
		this.width = width;
	}
	public Integer getHeight() {
		return height;
	}
	public void setHeight(Integer height) {
		this.height = height;
	}
	public Long getSize() {
		return size;
	}
	public void setSize(Long size) {
		this.size = size;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
}